cmake_minimum_required(VERSION 3.16)
project(main CXX)
# add_subdirectory：添加子目录
add_subdirectory(animal)
add_executable(main main.cpp)

# target_link_libraries：把库 AnimalLib 链接到可执行文件 main 里,可以写多个
target_link_libraries(main PUBLIC AnimalLib)

# target_include_directories：头文件目录的声明
# 告诉编译器：在编译 main 时，把 "${PROJECT_SOURCE_DIR}/animal" 加入头文件搜索路径,可以写多个
target_include_directories(main PUBLIC "${PROJECT_SOURCE_DIR}/animal")
